package com.example.advice;

import com.example.entity.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.sql.ResultSet;

import static com.example.entity.Result.error;

//@RestControllerAdvice
public class MyControllerAdvice {
    @ExceptionHandler(Exception.class)
    public Result<String> handleException(Exception e) {
        //记录日志.......
        e.printStackTrace();

        return Result.error("服务器正在升级");
    }
}
